package org.example.feign;

import org.example.pojo.Brand;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "microservice-order", path = "/brand")
public interface BrandFeignClient {

    /**
     * 查询所有品牌
     */
    @GetMapping("/queryAll")
    ResponseEntity<List<Brand>> queryAllBrand();

    /**
     * 根据ID查询品牌
     */
    @GetMapping("/{id}")
    ResponseEntity<Brand> queryBrandById(@PathVariable("id") Integer id);

    /**
     * 添加品牌
     */
    @PostMapping
    ResponseEntity<String> addBrand(@RequestBody Brand brand);

    /**
     * 更新品牌
     */
    @PutMapping("/{id}")
    ResponseEntity<String> updateBrand(@PathVariable("id") Integer id, @RequestBody Brand brand);

    /**
     * 删除品牌
     */
    @DeleteMapping("/{id}")
    ResponseEntity<String> deleteBrand(@PathVariable("id") Integer id);
}